package template_method.actors;

import template_method.roles.ConcreteMethodObject;

public class CharDisplay extends AbstractDisplay implements ConcreteMethodObject {
    private final char ch;    //需要显示的字符

    public CharDisplay(char ch) {
        this.ch = ch;
    }

    @Override
    public void open() {
        System.out.print("<<");
    }

    @Override
    public void print() {
        System.out.print(ch);
    }

    @Override
    public void close() {
        System.out.println(">>");
    }
}
